package team.seekers.skill.service;

import org.springframework.transaction.annotation.Transactional;
import team.seekers.skill.entity.dao.Chapter;
import com.baomidou.mybatisplus.extension.service.IService;
import team.seekers.skill.entity.vo.admin.add.AdminChapterAddVO;
import team.seekers.skill.entity.vo.admin.update.AdminChapterUpdateVO;
import team.seekers.skill.entity.vo.fore.list.ChapterListVO;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author hbc
 * @since 2021-01-18
 */
public interface ChapterService extends IService<Chapter> {

    @Transactional(rollbackFor=Exception.class)
    boolean add(AdminChapterAddVO adminChapterAddVO);

    @Transactional(rollbackFor=Exception.class)
    boolean delete(String chapterId);

    @Transactional(rollbackFor=Exception.class)
    boolean removeBySkillId(String skillId);

    List<AdminChapterUpdateVO> listAdminChapterUpdateVOBySkillId(String skillId);

    List<ChapterListVO> listChapterVOBySkillId(String id, String skillId);

    @Transactional(rollbackFor = Exception.class)
    boolean startLearn(String chapterId, String userId);

    @Transactional(rollbackFor=Exception.class)
    boolean endLearn(String chapterId, String userId);
}
